<?php
/**
 * @user:andy
 * @date:2021/7/3
 * @company:http://www.sjdphp.com
 * @desc:
 */

namespace app\admin\validate;


use think\Validate;

class MenuValidate extends Validate
{
    protected $rule = [
        'menu_id' => 'require|number',
        'menu_name' => 'require',
        'menu_type' => 'require|number',
    ];

    protected $message = [
        'menu_id.require'   => '菜单ID不能为空',
        'menu_id.number'    => '菜单ID类型错误',
        'menu_name.require' => '菜单名称不能为空',
        'menu_type.require' => '菜单类型不能为空',
        'menu_type.number'  => '菜单类型错误',
    ];

    protected $scene = [
        'add'  => ['menu_name','menu_type'],
        'edit' => ['menu_id','menu_name','menu_type'],
    ];
}